package com.zhang.buiness.amaster.workserver.web;

import com.zhang.buiness.amaster.workserver.service.WorkTransactionalServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("transactional/propagation")
public class WorkTransactionalController {

    @Autowired
    private WorkTransactionalServiceImpl workTractionService;

    @RequestMapping("test/required")
    public String requiredTransactional(){
       return workTractionService.propagationRequired("test/required");

    }

    @RequestMapping("test/required/nestedCall")
    public String propagationRequiredNestedCall(){
        return workTractionService.propagationRequiredNestedCall("test/required/nestedCall");

    }

    @RequestMapping("test/supports")
    public String supportsNotTransactional(){
        return workTractionService.supportsNotTransactional("test/supports");

    }

    @RequestMapping("test/supports/have")
    public String supportsHaveTransactional(){
        return workTractionService.supportsHaveTransactional("test/supports/have");

    }

    @RequestMapping("test/mandatory")
    public String mandatoryTransactional(){
        return workTractionService.mandatoryTransactional("test/mandatoryTransactional");

    }
    @RequestMapping("test/mandatory/nestedCall")
    public String mandatoryTransactionalNestedCall(){
        return workTractionService.mandatoryTransactionalNestedCall("test/mandatoryTransactionalNestedCall");

    }

    @RequestMapping("test/notsupport")
    public String notsupportsTransactional(){
        return workTractionService.notsupportsTransactional("test/notsupport");

    }
}
